﻿import flash.external.*

street_lst = []
street_id_lst = []
gird_lst = []
gird_pid_lst = []

//添加街道
function addst()
{
	ExternalInterface.call("myeditor_editor_street.inst.addst", txt_street.text);
}
btn_addst.addEventListener("click", this, "addst")

//设置街道列表数据
function reload_street_lst_data()
{
	slist = []
	for( var i:Number = 0; i < street_lst.length; i++)
	{
		item = {label:street_lst[i] , data:street_id_lst[i]}
		slist[i] = item
	}
	sll_street.dataProvider = slist	
}

//点击街道列表
function res_sel_item_click(e:Object)
{
	ExternalInterface.call("myeditor_editor_street.inst.sel_one_street", e.item.label, e.item.data);
}
sll_street.addEventListener("itemClick", this, "res_sel_item_click")

/////设置格子列表数据
function reload_grid_lst_data()
{
	slist = []
	for( var i:Number = 0; i < gird_lst.length; i++)
	{
		item = {label:gird_lst[i] , data:gird_pid_lst[i]}
		slist[i] = item
	}
	sll_grid.dataProvider = slist	
}
//添加格子
function add_grid()
{
	ExternalInterface.call("myeditor_editor_street.inst.add_grid", txt_street.text);
}
btn_add_grid.addEventListener("click", this, "add_grid")

//点击格子列表
function res_sel_grid_click(e:Object)
{
	ExternalInterface.call("myeditor_editor_street.inst.sel_one_grid", e.item.label, e.item.data);
}
sll_grid.addEventListener("itemClick", this, "res_sel_grid_click")

